;Copyright (C) Microsoft Corporation.  All Rights Reserved.
;File:       ddraw.h
;Content:    DirectDraw include file
DIRECTDRAW_VERSION = $700

;CLSID_DirectDraw GUID $D7B70EE0,$4340,$11CF,<$B0,$63,$00,$20,$AF,$C2,$CD,$35>
;CLSID_DirectDraw7 GUID $3c305196,$50db,$11d3,<$9c,$fe,$00,$c0,$4f,$d9,$30,$c5>
;CLSID_DirectDrawClipper GUID $593817A0,$7DB3,$11CF,<$A2,$DE,$00,$AA,$00,$b9,$33,$56>
;IID_IDirectDraw GUID $6C14DB80,$A733,$11CE,<$A5,$21,$00,$20,$AF,$0B,$E5,$60>
;IID_IDirectDraw2 GUID $B3A6F3E0,$2B43,$11CF,<$A2,$DE,$00,$AA,$00,$B9,$33,$56>
;IID_IDirectDraw4 GUID $9c59509a,$39bd,$11d1,<$8c,$4a,$00,$c0,$4f,$d9,$30,$c5>
;IID_IDirectDraw7 GUID $15e65ec0,$3b9c,$11d2,<$b9,$2f,$00,$60,$97,$97,$ea,$5b>
;IID_IDirectDrawSurface GUID $6C14DB81,$A733,$11CE,<$A5,$21,$00,$20,$AF,$0B,$E5,$60>
;IID_IDirectDrawSurface2 GUID $57805885,$6eec,$11cf,<$94,$41,$a8,$23,$03,$c1,$0e,$27>
;IID_IDirectDrawSurface3 GUID $DA044E00,$69B2,$11D0,<$A1,$D5,$00,$AA,$00,$B8,$DF,$BB>
;IID_IDirectDrawSurface4 GUID $0B2B8630,$AD35,$11D0,<$8E,$A6,$00,$60,$97,$97,$EA,$5B>
;IID_IDirectDrawSurface7 GUID $06675a80,$3b9b,$11d2,<$b9,$2f,$00,$60,$97,$97,$ea,$5b>
;IID_IDirectDrawPalette GUID $6C14DB84,$A733,$11CE,<$A5,$21,$00,$20,$AF,$0B,$E5,$60>
;IID_IDirectDrawClipper GUID $6C14DB85,$A733,$11CE,<$A5,$21,$00,$20,$AF,$0B,$E5,$60>
;IID_IDirectDrawColorControl GUID $4B9F0EE0,$0D7E,$11D0,<$9B,$06,$00,$A0,$C9,$03,$A3,$B8>
;IID_IDirectDrawGammaControl GUID $69C11C3E,$B46B,$11D1,<$AD,$7A,$00,$C0,$4F,$C2,$9B,$4E>

FOURCC_DXT1 equ 'DXT1'
FOURCC_DXT2 equ 'DXT2'
FOURCC_DXT3 equ 'DXT3'
FOURCC_DXT4 equ 'DXT4'
FOURCC_DXT5 equ 'DXT5'

DDENUM_ATTACHEDSECONDARYDEVICES = 1
DDENUM_DETACHEDSECONDARYDEVICES = 2
DDENUM_NONDISPLAYDEVICES = 4

REGSTR_KEY_DDHW_DESCRIPTION equ "Description"
REGSTR_KEY_DDHW_DRIVERNAME equ "DriverName"
REGSTR_PATH_DDHW equ "Hardware\\DirectDrawDrivers"

DDCREATE_HARDWAREONLY = 1
DDCREATE_EMULATIONONLY = 2

struct DDARGB
       blue db ?
       green db ?
       red db ?
       alpha db ?
ends

struct DDRGBA
       red db ?
       green db ?
       blue db ?
       alpha db ?
ends

struct DDCOLORKEY
       dwColorSpaceLowValue dd ?
       dwColorSpaceHighValue dd ?
ends

struct DDBLTFX ;128
       dwSize dd ?
       dwDDFX dd ?
       dwROP dd ?
       dwDDROP dd ?
       dwRotationAngle dd ?
       dwZBufferOpCode dd ?
       dwZBufferLow dd ?
       dwZBufferHigh dd ?
       dwZBufferBaseDest dd ?
       dwZDestConstBitDepth dd ?
       union
	   dwZDestConst dd ?
	   lpDDSZBufferDest dq ?
       ends
       dwZSrcConstBitDepth dd ?
       pad1 dd ?
       union
	   dwZSrcConst dd ?
	   lpDDSZBufferSrc dq ?
       ends
       dwAlphaEdgeBlendBitDepth dd ?
       dwAlphaEdgeBlend dd ?
       dwReserved dd ?
       dwAlphaDestConstBitDepth dd ?
       union
	   dwAlphaDestConst dd ?
	   lpDDSAlphaDest dq ?
       ends
       dwAlphaSrcConstBitDepth dd ?
       pad2 dd ?
       union
	   dwAlphaSrcConst dd ?
	   lpDDSAlphaSrc dq ?
       ends
       union
	   dwFillColor dd ?
	   dwFillDepth dd ?
	   dwFillPixel dd ?
	   lpDDSPattern dq ?
       ends
       ddckDestColorkey DDCOLORKEY
       ddckSrcColorkey DDCOLORKEY
ends

struct DDSCAPS
       dwCaps dd ?
ends

struct DDOSCAPS
       dwCaps dd ?
ends

struct DDSCAPSEX
       dwCaps2 dd ?
       dwCaps3 dd ?
       union
	   dwCaps4 dd ?
	   dwVolumeDepth dd ?
       ends
ends

struct DDSCAPS2
       dwCaps dd ?
       dwCaps2 dd ?
       dwCaps3 dd ?
       union
	   dwCaps4 dd ?
	   dwVolumeDepth dd ?
       ends
ends

DD_ROP_SPACE = (256/32)

struct DDCAPSDX1
       dwSize dd ?
       dwCaps dd ?
       dwCaps2 dd ?
       dwCKeyCaps dd ?
       dwFXCaps dd ?
       dwFXAlphaCaps dd ?
       dwPalCaps dd ?
       dwSVCaps dd ?
       dwAlphaBltConstBitDepths dd ?
       dwAlphaBltPixelBitDepths dd ?
       dwAlphaBltSurfaceBitDepths dd ?
       dwAlphaOverlayConstBitDepths dd ?
       dwAlphaOverlayPixelBitDepths dd ?
       dwAlphaOverlaySurfaceBitDepths dd ?
       dwZBufferBitDepths dd ?
       dwVidMemTotal dd ?
       dwVidMemFree dd ?
       dwMaxVisibleOverlays dd ?
       dwCurrVisibleOverlays dd ?
       dwNumFourCCCodes dd ?
       dwAlignBoundarySrc dd ?
       dwAlignSizeSrc dd ?
       dwAlignBoundaryDest dd ?
       dwAlignSizeDest dd ?
       dwAlignStrideAlign dd ?
       dwRops dd DD_ROP_SPACE dup(?)
       ddsCaps DDSCAPS
       dwMinOverlayStretch dd ?
       dwMaxOverlayStretch dd ?
       dwMinLiveVideoStretch dd ?
       dwMaxLiveVideoStretch dd ?
       dwMinHwCodecStretch dd ?
       dwMaxHwCodecStretch dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
       dwReserved3 dd ?
ends

struct DDCAPSDX3
       dwSize dd ?
       dwCaps dd ?
       dwCaps2 dd ?
       dwCKeyCaps dd ?
       dwFXCaps dd ?
       dwFXAlphaCaps dd ?
       dwPalCaps dd ?
       dwSVCaps dd ?
       dwAlphaBltConstBitDepths dd ?
       dwAlphaBltPixelBitDepths dd ?
       dwAlphaBltSurfaceBitDepths dd ?
       dwAlphaOverlayConstBitDepths dd ?
       dwAlphaOverlayPixelBitDepths dd ?
       dwAlphaOverlaySurfaceBitDepths dd ?
       dwZBufferBitDepths dd ?
       dwVidMemTotal dd ?
       dwVidMemFree dd ?
       dwMaxVisibleOverlays dd ?
       dwCurrVisibleOverlays dd ?
       dwNumFourCCCodes dd ?
       dwAlignBoundarySrc dd ?
       dwAlignSizeSrc dd ?
       dwAlignBoundaryDest dd ?
       dwAlignSizeDest dd ?
       dwAlignStrideAlign dd ?
       dwRops dd DD_ROP_SPACE dup(?)
       ddsCaps DDSCAPS
       dwMinOverlayStretch dd ?
       dwMaxOverlayStretch dd ?
       dwMinLiveVideoStretch dd ?
       dwMaxLiveVideoStretch dd ?
       dwMinHwCodecStretch dd ?
       dwMaxHwCodecStretch dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
       dwReserved3 dd ?
       dwSVBCaps dd ?
       dwSVBCKeyCaps dd ?
       dwSVBFXCaps dd ?
       dwSVBRops dd DD_ROP_SPACE dup(?)
       dwVSBCaps dd ?
       dwVSBCKeyCaps dd ?
       dwVSBFXCaps dd ?
       dwVSBRops dd DD_ROP_SPACE dup(?)
       dwSSBCaps dd ?
       dwSSBCKeyCaps dd ?
       dwSSBFXCaps dd ?
       dwSSBRops dd DD_ROP_SPACE dup(?)
       dwReserved4 dd ?
       dwReserved5 dd ?
       dwReserved6 dd ?
ends

struct DDCAPSDX5
       dwSize dd ?
       dwCaps dd ?
       dwCaps2 dd ?
       dwCKeyCaps dd ?
       dwFXCaps dd ?
       dwFXAlphaCaps dd ?
       dwPalCaps dd ?
       dwSVCaps dd ?
       dwAlphaBltConstBitDepths dd ?
       dwAlphaBltPixelBitDepths dd ?
       dwAlphaBltSurfaceBitDepths dd ?
       dwAlphaOverlayConstBitDepths dd ?
       dwAlphaOverlayPixelBitDepths dd ?
       dwAlphaOverlaySurfaceBitDepths dd ?
       dwZBufferBitDepths dd ?
       dwVidMemTotal dd ?
       dwVidMemFree dd ?
       dwMaxVisibleOverlays dd ?
       dwCurrVisibleOverlays dd ?
       dwNumFourCCCodes dd ?
       dwAlignBoundarySrc dd ?
       dwAlignSizeSrc dd ?
       dwAlignBoundaryDest dd ?
       dwAlignSizeDest dd ?
       dwAlignStrideAlign dd ?
       dwRops dd DD_ROP_SPACE dup(?)
       ddsCaps DDSCAPS
       dwMinOverlayStretch dd ?
       dwMaxOverlayStretch dd ?
       dwMinLiveVideoStretch dd ?
       dwMaxLiveVideoStretch dd ?
       dwMinHwCodecStretch dd ?
       dwMaxHwCodecStretch dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
       dwReserved3 dd ?
       dwSVBCaps dd ?
       dwSVBCKeyCaps dd ?
       dwSVBFXCaps dd ?
       dwSVBRops dd DD_ROP_SPACE dup(?)
       dwVSBCaps dd ?
       dwVSBCKeyCaps dd ?
       dwVSBFXCaps dd ?
       dwVSBRops dd DD_ROP_SPACE dup(?)
       dwSSBCaps dd ?
       dwSSBCKeyCaps dd ?
       dwSSBFXCaps dd ?
       dwSSBRops dd DD_ROP_SPACE dup(?)
       ;Members added for DX5:
       dwMaxVideoPorts dd ?
       dwCurrVideoPorts dd ?
       dwSVBCaps2 dd ?
       dwNLVBCaps dd ?
       dwNLVBCaps2 dd ?
       dwNLVBCKeyCaps dd ?
       dwNLVBFXCaps dd ?
       dwNLVBRops dd DD_ROP_SPACE dup(?)
ends

struct DDCAPSDX6
       dwSize dd ?
       dwCaps dd ?
       dwCaps2 dd ?
       dwCKeyCaps dd ?
       dwFXCaps dd ?
       dwFXAlphaCaps dd ?
       dwPalCaps dd ?
       dwSVCaps dd ?
       dwAlphaBltConstBitDepths dd ?
       dwAlphaBltPixelBitDepths dd ?
       dwAlphaBltSurfaceBitDepths dd ?
       dwAlphaOverlayConstBitDepths dd ?
       dwAlphaOverlayPixelBitDepths dd ?
       dwAlphaOverlaySurfaceBitDepths dd ?
       dwZBufferBitDepths dd ?
       dwVidMemTotal dd ?
       dwVidMemFree dd ?
       dwMaxVisibleOverlays dd ?
       dwCurrVisibleOverlays dd ?
       dwNumFourCCCodes dd ?
       dwAlignBoundarySrc dd ?
       dwAlignSizeSrc dd ?
       dwAlignBoundaryDest dd ?
       dwAlignSizeDest dd ?
       dwAlignStrideAlign dd ?
       dwRops dd DD_ROP_SPACE dup(?)
       ddsOldCaps DDSCAPS
       dwMinOverlayStretch dd ?
       dwMaxOverlayStretch dd ?
       dwMinLiveVideoStretch dd ?
       dwMaxLiveVideoStretch dd ?
       dwMinHwCodecStretch dd ?
       dwMaxHwCodecStretch dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
       dwReserved3 dd ?
       dwSVBCaps dd ?
       dwSVBCKeyCaps dd ?
       dwSVBFXCaps dd ?
       dwSVBRops dd DD_ROP_SPACE dup(?)
       dwVSBCaps dd ?
       dwVSBCKeyCaps dd ?
       dwVSBFXCaps dd ?
       dwVSBRops dd DD_ROP_SPACE dup(?)
       dwSSBCaps dd ?
       dwSSBCKeyCaps dd ?
       dwSSBFXCaps dd ?
       dwSSBRops dd DD_ROP_SPACE dup(?)
       dwMaxVideoPorts dd ?
       dwCurrVideoPorts dd ?
       dwSVBCaps2 dd ?
       dwNLVBCaps dd ?
       dwNLVBCaps2 dd ?
       dwNLVBCKeyCaps dd ?
       dwNLVBFXCaps dd ?
       dwNLVBRops dd DD_ROP_SPACE dup(?)
       ;Members added for DX6 release
       ddsCaps DDSCAPS2
ends

struct DDCAPSDX7
       dwSize dd ?
       dwCaps dd ?
       dwCaps2 dd ?
       dwCKeyCaps dd ?
       dwFXCaps dd ?
       dwFXAlphaCaps dd ?
       dwPalCaps dd ?
       dwSVCaps dd ?
       dwAlphaBltConstBitDepths dd ?
       dwAlphaBltPixelBitDepths dd ?
       dwAlphaBltSurfaceBitDepths dd ?
       dwAlphaOverlayConstBitDepths dd ?
       dwAlphaOverlayPixelBitDepths dd ?
       dwAlphaOverlaySurfaceBitDepths dd ?
       dwZBufferBitDepths dd ?
       dwVidMemTotal dd ?
       dwVidMemFree dd ?
       dwMaxVisibleOverlays dd ?
       dwCurrVisibleOverlays dd ?
       dwNumFourCCCodes dd ?
       dwAlignBoundarySrc dd ?
       dwAlignSizeSrc dd ?
       dwAlignBoundaryDest dd ?
       dwAlignSizeDest dd ?
       dwAlignStrideAlign dd ?
       dwRops dd DD_ROP_SPACE dup(?)
       ddsOldCaps DDSCAPS
       dwMinOverlayStretch dd ?
       dwMaxOverlayStretch dd ?
       dwMinLiveVideoStretch dd ?
       dwMaxLiveVideoStretch dd ?
       dwMinHwCodecStretch dd ?
       dwMaxHwCodecStretch dd ?
       dwReserved1 dd ?
       dwReserved2 dd ?
       dwReserved3 dd ?
       dwSVBCaps dd ?
       dwSVBCKeyCaps dd ?
       dwSVBFXCaps dd ?
       dwSVBRops dd DD_ROP_SPACE dup(?)
       dwVSBCaps dd ?
       dwVSBCKeyCaps dd ?
       dwVSBFXCaps dd ?
       dwVSBRops dd DD_ROP_SPACE dup(?)
       dwSSBCaps dd ?
       dwSSBCKeyCaps dd ?
       dwSSBFXCaps dd ?
       dwSSBRops dd DD_ROP_SPACE dup(?)
       dwMaxVideoPorts dd ?
       dwCurrVideoPorts dd ?
       dwSVBCaps2 dd ?
       dwNLVBCaps dd ?
       dwNLVBCaps2 dd ?
       dwNLVBCKeyCaps dd ?
       dwNLVBFXCaps dd ?
       dwNLVBRops dd DD_ROP_SPACE dup(?)
       ;Members added for DX6 release
       ddsCaps DDSCAPS2
ends

struct DDPIXELFORMAT
       dwSize dd ?
       dwFlags dd ?
       dwFourCC dd ?
       union
	   dwRGBBitCount dd ?
	   dwYUVBitCount dd ?
	   dwZBufferBitDepth dd ?
	   dwAlphaBitDepth dd ?
	   dwLuminanceBitCount dd ?
	   dwBumpBitCount dd ?
	   dwPrivateFormatBitCount dd ?
       ends
       union
	   dwRBitMask dd ?
	   dwYBitMask dd ?
	   dwStencilBitDepth dd ?
	   dwLuminanceBitMask dd ?
	   dwBumpDuBitMask dd ?
	   dwOperations dd ?
       ends
       union
	   dwGBitMask dd ?
	   dwUBitMask dd ?
	   dwZBitMask dd ?
	   dwBumpDvBitMask dd ?
	   struct
		  wFlipMSTypes dw ?
		  wBltMSTypes dw ?
	   ends
       ends
       union
	   dwBBitMask dd ?
	   dwVBitMask dd ?
	   dwStencilBitMask dd ?
	   dwBumpLuminanceBitMask dd ?
       ends
       union
	   dwRGBAlphaBitMask dd ?
	   dwYUVAlphaBitMask dd ?
	   dwLuminanceAlphaBitMask dd ?
	   dwRGBZBitMask dd ?
	   dwYUVZBitMask dd ?
       ends
ends

struct DDOVERLAYFX
       dwSize dd ?
       dwAlphaEdgeBlendBitDepth dd ?
       dwAlphaEdgeBlend dd ?
       dwReserved dd ?
       dwAlphaDestConstBitDepth dd ?
       pad1 dd ?
       union
	   dwAlphaDestConst dd ?
	   lpDDSAlphaDest dq ?
       ends
       dwAlphaSrcConstBitDepth dd ?
       pad2 dd ?
       union
	   dwAlphaSrcConst dd ?
	   lpDDSAlphaSrc dq ?
       ends
       dckDestColorkey DDCOLORKEY
       dckSrcColorkey DDCOLORKEY
       dwDDFX dd ?
       dwFlags dd ?
ends

struct DDBLTBATCH
       lprDest dq ?
       lpDDSSrc dq ?
       lprSrc dq ?
       dwFlags dd ?
       pad1 dd ?
       lpDDBltFx dq ?
ends

struct DDGAMMARAMP
       red dw 256 dup(?)
       green dw 256 dup(?)
       blue dw 256 dup(?)
ends

MAX_DDDEVICEID_STRING = 512

struct DDDEVICEIDENTIFIER
       szDriver db MAX_DDDEVICEID_STRING dup(?)
       szDescription db MAX_DDDEVICEID_STRING dup(?)
       liDriverVersion dq ?
       dwVendorId dd ?
       dwDeviceId dd ?
       dwSubSysId dd ?
       dwRevision dd ?
       guidDeviceIdentifier GUID
ends

struct DDDEVICEIDENTIFIER2
       szDriver db MAX_DDDEVICEID_STRING dup(?)
       szDescription db MAX_DDDEVICEID_STRING dup(?)
       liDriverVersion dq ?
       dwVendorId dd ?
       dwDeviceId dd ?
       dwSubSysId dd ?
       dwRevision dd ?
       guidDeviceIdentifier GUID
       dwWHQLLevel dd ?
       pad1 dd ?
ends

DDGDI_GETHOSTIDENTIFIER = 1

;Macros for interpretting DDEVICEIDENTIFIER2.dwWHQLLevel
macro GET_WHQL_YEAR  dwWHQLLevel { ;result in eax
      mov     ecx, $10000
      mov     eax, [dwWHQLLevel]
      mov     edx, 0
      div     ecx
}

macro GET_WHQL_MONTH  dwWHQLLevel { ;result in eax
      mov     ecx, $100
      mov     eax, [dwWHQLLevel]
      mov     edx, 0
      div     ecx
      and     eax, $ff
}

macro GET_WHQL_DAY  dwWHQLLevel {
      mov     eax, [dwWHQLLevel]
      and     eax, $ff
}


interface IDirectDraw,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Compact,\
	  CreateClipper,\
	  CreatePalette,\
	  CreateSurface,\
	  DuplicateSurface,\
	  EnumDisplayModes,\
	  EnumSurfaces,\
	  FlipToGDISurface,\
	  GetCaps,\
	  GetDisplayMode,\
	  GetFourCCCodes,\
	  GetGDISurface,\
	  GetMonitorFrequency,\
	  GetScanLine,\
	  GetVerticalBlankStatus,\
	  Initialize,\
	  RestoreDisplayMode,\
	  SetCooperativeLevel,\
	  SetDisplayMode,\
	  WaitForVerticalBlank

interface IDirectDraw2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Compact,\
	  CreateClipper,\
	  CreatePalette,\
	  CreateSurface,\
	  DuplicateSurface,\
	  EnumDisplayModes,\
	  EnumSurfaces,\
	  FlipToGDISurface,\
	  GetCaps,\
	  GetDisplayMode,\
	  GetFourCCCodes,\
	  GetGDISurface,\
	  GetMonitorFrequency,\
	  GetScanLine,\
	  GetVerticalBlankStatus,\
	  Initialize,\
	  RestoreDisplayMode,\
	  SetCooperativeLevel,\
	  SetDisplayMode,\
	  WaitForVerticalBlank,\
	  GetAvailableVidMem

interface IDirectDraw4,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Compact,\
	  CreateClipper,\
	  CreatePalette,\
	  CreateSurface,\
	  DuplicateSurface,\
	  EnumDisplayModes,\
	  EnumSurfaces,\
	  FlipToGDISurface,\
	  GetCaps,\
	  GetDisplayMode,\
	  GetFourCCCodes,\
	  GetGDISurface,\
	  GetMonitorFrequency,\
	  GetScanLine,\
	  GetVerticalBlankStatus,\
	  Initialize,\
	  RestoreDisplayMode,\
	  SetCooperativeLevel,\
	  SetDisplayMode,\
	  WaitForVerticalBlank,\
	  GetAvailableVidMem,\
	  GetSurfaceFromDC,\
	  RestoreAllSurfaces,\
	  TestCooperativeLevel,\
	  GetDeviceIdentifier

interface IDirectDraw7,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  Compact,\
	  CreateClipper,\
	  CreatePalette,\
	  CreateSurface,\
	  DuplicateSurface,\
	  EnumDisplayModes,\
	  EnumSurfaces,\
	  FlipToGDISurface,\
	  GetCaps,\
	  GetDisplayMode,\
	  GetFourCCCodes,\
	  GetGDISurface,\
	  GetMonitorFrequency,\
	  GetScanLine,\
	  GetVerticalBlankStatus,\
	  Initialize,\
	  RestoreDisplayMode,\
	  SetCooperativeLevel,\
	  SetDisplayMode,\
	  WaitForVerticalBlank,\
	  GetAvailableVidMem,\
	  GetSurfaceFromDC,\
	  RestoreAllSurfaces,\
	  TestCooperativeLevel,\
	  GetDeviceIdentifier,\
	  StartModeTest,\
	  EvaluateMode

interface IDirectDrawPalette,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetCaps,\
	  GetEntries,\
	  Initialize,\
	  SetEntries

interface IDirectDrawClipper,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetClipList,\
	  GetHWnd,\
	  Initialize,\
	  IsClipListChanged,\
	  SetClipList,\
	  SetHWnd

interface IDirectDrawSurface,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddAttachedSurface,\
	  AddOverlayDirtyRect,\
	  Blt,\
	  BltBatch,\
	  BltFast,\
	  DeleteAttachedSurface,\
	  EnumAttachedSurfaces,\
	  EnumOverlayZOrders,\
	  Flip,\
	  GetAttachedSurface,\
	  GetBltStatus,\
	  GetCaps,\
	  GetClipper,\
	  GetColorKey,\
	  GetDC,\
	  GetFlipStatus,\
	  GetOverlayPosition,\
	  GetPalette,\
	  GetPixelFormat,\
	  GetSurfaceDesc,\
	  Initialize,\
	  IsLost,\
	  Lock,\
	  ReleaseDC,\
	  Restore,\
	  SetClipper,\
	  SetColorKey,\
	  SetOverlayPosition,\
	  SetPalette,\
	  Unlock,\
	  UpdateOverlay,\
	  UpdateOverlayDisplay,\
	  UpdateOverlayZOrder

interface IDirectDrawSurface2,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddAttachedSurface,\
	  AddOverlayDirtyRect,\
	  Blt,\
	  BltBatch,\
	  BltFast,\
	  DeleteAttachedSurface,\
	  EnumAttachedSurfaces,\
	  EnumOverlayZOrders,\
	  Flip,\
	  GetAttachedSurface,\
	  GetBltStatus,\
	  GetCaps,\
	  GetClipper,\
	  GetColorKey,\
	  GetDC,\
	  GetFlipStatus,\
	  GetOverlayPosition,\
	  GetPalette,\
	  GetPixelFormat,\
	  GetSurfaceDesc,\
	  Initialize,\
	  IsLost,\
	  Lock,\
	  ReleaseDC,\
	  Restore,\
	  SetClipper,\
	  SetColorKey,\
	  SetOverlayPosition,\
	  SetPalette,\
	  Unlock,\
	  UpdateOverlay,\
	  UpdateOverlayDisplay,\
	  UpdateOverlayZOrder,\
	  GetDDInterface,\
	  PageLock,\
	  PageUnlock

interface IDirectDrawSurface3,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddAttachedSurface,\
	  AddOverlayDirtyRect,\
	  Blt,\
	  BltBatch,\
	  BltFast,\
	  DeleteAttachedSurface,\
	  EnumAttachedSurfaces,\
	  EnumOverlayZOrders,\
	  Flip,\
	  GetAttachedSurface,\
	  GetBltStatus,\
	  GetCaps,\
	  GetClipper,\
	  GetColorKey,\
	  GetDC,\
	  GetFlipStatus,\
	  GetOverlayPosition,\
	  GetPalette,\
	  GetPixelFormat,\
	  GetSurfaceDesc,\
	  Initialize,\
	  IsLost,\
	  Lock,\
	  ReleaseDC,\
	  Restore,\
	  SetClipper,\
	  SetColorKey,\
	  SetOverlayPosition,\
	  SetPalette,\
	  Unlock,\
	  UpdateOverlay,\
	  UpdateOverlayDisplay,\
	  UpdateOverlayZOrder,\
	  GetDDInterface,\
	  PageLock,\
	  PageUnlock,\
	  SetSurfaceDesc

interface IDirectDrawSurface4,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddAttachedSurface,\
	  AddOverlayDirtyRect,\
	  Blt,\
	  BltBatch,\
	  BltFast,\
	  DeleteAttachedSurface,\
	  EnumAttachedSurfaces,\
	  EnumOverlayZOrders,\
	  Flip,\
	  GetAttachedSurface,\
	  GetBltStatus,\
	  GetCaps,\
	  GetClipper,\
	  GetColorKey,\
	  GetDC,\
	  GetFlipStatus,\
	  GetOverlayPosition,\
	  GetPalette,\
	  GetPixelFormat,\
	  GetSurfaceDesc,\
	  Initialize,\
	  IsLost,\
	  Lock,\
	  ReleaseDC,\
	  Restore,\
	  SetClipper,\
	  SetColorKey,\
	  SetOverlayPosition,\
	  SetPalette,\
	  Unlock,\
	  UpdateOverlay,\
	  UpdateOverlayDisplay,\
	  UpdateOverlayZOrder,\
	  GetDDInterface,\
	  PageLock,\
	  PageUnlock,\
	  SetSurfaceDesc,\
	  SetPrivateData,\
	  GetPrivateData,\
	  FreePrivateData,\
	  GetUniquenessValue,\
	  ChangeUniquenessValue

interface IDirectDrawSurface7,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  AddAttachedSurface,\
	  AddOverlayDirtyRect,\
	  Blt,\
	  BltBatch,\
	  BltFast,\
	  DeleteAttachedSurface,\
	  EnumAttachedSurfaces,\
	  EnumOverlayZOrders,\
	  Flip,\
	  GetAttachedSurface,\
	  GetBltStatus,\
	  GetCaps,\
	  GetClipper,\
	  GetColorKey,\
	  GetDC,\
	  GetFlipStatus,\
	  GetOverlayPosition,\
	  GetPalette,\
	  GetPixelFormat,\
	  GetSurfaceDesc,\
	  Initialize,\
	  IsLost,\
	  Lock,\
	  ReleaseDC,\
	  Restore,\
	  SetClipper,\
	  SetColorKey,\
	  SetOverlayPosition,\
	  SetPalette,\
	  Unlock,\
	  UpdateOverlay,\
	  UpdateOverlayDisplay,\
	  UpdateOverlayZOrder,\
	  GetDDInterface,\
	  PageLock,\
	  PageUnlock,\
	  SetSurfaceDesc,\
	  SetPrivateData,\
	  GetPrivateData,\
	  FreePrivateData,\
	  GetUniquenessValue,\
	  ChangeUniquenessValue,\
	  SetPriority,\
	  GetPriority,\
	  SetLOD,\
	  GetLOD

interface IDirectDrawColorControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetColorControls,\
	  SetColorControls

interface IDirectDrawGammaControl,\
	  QueryInterface,\
	  AddRef,\
	  Release,\
	  GetGammaRamp,\
	  SetGammaRamp

struct DDSURFACEDESC
       dwSize dd ?
       dwFlags dd ?
       dwHeight dd ?
       dwWidth dd ?
       union
	   lPitch dd ?
	   dwLinearSize dd ?
       ends
       dwBackBufferCount dd ?
       union
	   dwMipMapCount dd ?
	   dwZBufferBitDepth dd ?
	   dwRefreshRate dd ?
       ends
       dwAlphaBitDepth dd ?
       dwReserved dd ?
       pad1 dd ?
       lpSurface dq ?
       ddckCKDestOverlay DDCOLORKEY
       ddckCKDestBlt DDCOLORKEY
       ddckCKSrcOverlay DDCOLORKEY
       ddckCKSrcBlt DDCOLORKEY
       ddpfPixelFormat DDPIXELFORMAT
       ddsCaps DDSCAPS
       pad2 dd ?
ends

struct DDSURFACEDESC2
       dwSize dd ?
       dwFlags dd ?
       dwHeight dd ?
       dwWidth dd ?
       union
	   lPitch dd ?
	   dwLinearSize dd ?
       ends
       union
	   dwBackBufferCount dd ?
	   dwDepth dd ?
       ends
       union
	   dwMipMapCount dd ?
	   dwRefreshRate dd ?
	   dwSrcVBHandle dd ?
       ends
       dwAlphaBitDepth dd ?
       dwReserved dd ?
       pad1 dd ?
       lpSurface dq ?
       union
	   ddckCKDestOverlay DDCOLORKEY
	   dwEmptyFaceColor dd ?
       ends
       ddckCKDestBlt DDCOLORKEY
       ddckCKSrcOverlay DDCOLORKEY
       ddckCKSrcBlt DDCOLORKEY
       union
	   ddpfPixelFormat DDPIXELFORMAT
	   dwFVF dd ?
       ends
       ddsCaps DDSCAPS2
       dwTextureStage dd ?
       pad2 dd ?
ends

DDSD_CAPS = 1
DDSD_HEIGHT = 2
DDSD_WIDTH = 4
DDSD_PITCH = 8
DDSD_BACKBUFFERCOUNT = $20
DDSD_ZBUFFERBITDEPTH = $40
DDSD_ALPHABITDEPTH = $80
DDSD_LPSURFACE = $800
DDSD_PIXELFORMAT = $1000
DDSD_CKDESTOVERLAY = $2000
DDSD_CKDESTBLT = $4000
DDSD_CKSRCOVERLAY = $8000
DDSD_CKSRCBLT = $10000
DDSD_MIPMAPCOUNT = $20000
DDSD_REFRESHRATE = $40000
DDSD_LINEARSIZE = $80000
DDSD_TEXTURESTAGE = $100000
DDSD_FVF = $200000
DDSD_SRCVBHANDLE = $400000
DDSD_DEPTH = $800000
DDSD_ALL = $fff9ee

struct DDOPTSURFACEDESC
       dwSize dd ?
       dwFlags dd ?
       ddSCaps DDSCAPS2
       ddOSCaps DDOSCAPS
       guid GUID
       dwCompressionRatio dd ?
ends

DDOSD_GUID = 1
DDOSD_COMPRESSION_RATIO = 2
DDOSD_SCAPS = 4
DDOSD_OSCAPS = 8
DDOSD_ALL = $f

DDOSDCAPS_OPTCOMPRESSED = 1
DDOSDCAPS_OPTREORDERED = 2
DDOSDCAPS_MONOLITHICMIPMAP = 4
DDOSDCAPS_VALIDSCAPS = $30004800
DDOSDCAPS_VALIDOSCAPS = 7

struct DDCOLORCONTROL
       dwSize dd ?
       dwFlags dd ?
       lBrightness dd ?
       lContrast dd ?
       lHue dd ?
       lSaturation dd ?
       lSharpness dd ?
       lGamma dd ?
       lColorEnable dd ?
       dwReserved1 dd ?
ends

DDCOLOR_BRIGHTNESS = 1
DDCOLOR_CONTRAST = 2
DDCOLOR_HUE = 4
DDCOLOR_SATURATION = 8
DDCOLOR_SHARPNESS = $10
DDCOLOR_GAMMA = $20
DDCOLOR_COLORENABLE = $40

DDSCAPS_RESERVED1 = 1
DDSCAPS_ALPHA = 2
DDSCAPS_BACKBUFFER = 4
DDSCAPS_COMPLEX = 8
DDSCAPS_FLIP = $10
DDSCAPS_FRONTBUFFER = $20
DDSCAPS_OFFSCREENPLAIN = $40
DDSCAPS_OVERLAY = $80
DDSCAPS_PALETTE = $100
DDSCAPS_PRIMARYSURFACE = $200
DDSCAPS_RESERVED3 = $400
DDSCAPS_PRIMARYSURFACELEFT = 0
DDSCAPS_SYSTEMMEMORY = $800
DDSCAPS_TEXTURE = $1000
DDSCAPS_3DDEVICE = $2000
DDSCAPS_VIDEOMEMORY = $4000
DDSCAPS_VISIBLE = $8000
DDSCAPS_WRITEONLY = $10000
DDSCAPS_ZBUFFER = $20000
DDSCAPS_OWNDC = $40000
DDSCAPS_LIVEVIDEO = $80000
DDSCAPS_HWCODEC = $100000
DDSCAPS_MODEX = $200000
DDSCAPS_MIPMAP = $400000
DDSCAPS_RESERVED2 = $800000
DDSCAPS_ALLOCONLOAD = $4000000
DDSCAPS_VIDEOPORT = $8000000
DDSCAPS_LOCALVIDMEM = $10000000
DDSCAPS_NONLOCALVIDMEM = $20000000
DDSCAPS_STANDARDVGAMODE = $40000000
DDSCAPS_OPTIMIZED = $80000000

DDSCAPS2_RESERVED4 = 2
DDSCAPS2_HARDWAREDEINTERLACE = 0
DDSCAPS2_HINTDYNAMIC = $4
DDSCAPS2_HINTSTATIC = $8
DDSCAPS2_TEXTUREMANAGE = $10
DDSCAPS2_RESERVED1 = $20
DDSCAPS2_RESERVED2 = $40
DDSCAPS2_OPAQUE = $80
DDSCAPS2_HINTANTIALIASING = $100
DDSCAPS2_CUBEMAP = $200
DDSCAPS2_CUBEMAP_POSITIVEX = $400
DDSCAPS2_CUBEMAP_NEGATIVEX = $800
DDSCAPS2_CUBEMAP_POSITIVEY = $1000
DDSCAPS2_CUBEMAP_NEGATIVEY = $2000
DDSCAPS2_CUBEMAP_POSITIVEZ = $4000
DDSCAPS2_CUBEMAP_NEGATIVEZ = $8000
DDSCAPS2_CUBEMAP_ALLFACES = DDSCAPS2_CUBEMAP_POSITIVEX or DDSCAPS2_CUBEMAP_NEGATIVEX or\
			    DDSCAPS2_CUBEMAP_POSITIVEY or DDSCAPS2_CUBEMAP_NEGATIVEY or\
			    DDSCAPS2_CUBEMAP_POSITIVEZ or DDSCAPS2_CUBEMAP_NEGATIVEZ
DDSCAPS2_MIPMAPSUBLEVEL = $10000
DDSCAPS2_D3DTEXTUREMANAGE = $20000
DDSCAPS2_DONOTPERSIST = $40000
DDSCAPS2_STEREOSURFACELEFT = $80000
DDSCAPS2_VOLUME = $200000
DDSCAPS2_NOTUSERLOCKABLE = $400000
DDSCAPS2_POINTS = $800000
DDSCAPS2_RTPATCHES = $1000000
DDSCAPS2_NPATCHES = $2000000
DDSCAPS2_RESERVED3 = $4000000
DDSCAPS2_DISCARDBACKBUFFER = $10000000
DDSCAPS2_ENABLEALPHACHANNEL = $20000000
DDSCAPS2_EXTENDEDFORMATPRIMARY = $40000000
DDSCAPS2_ADDITIONALPRIMARY = $80000000

DDSCAPS3_MULTISAMPLE_MASK = $1F
DDSCAPS3_MULTISAMPLE_QUALITY_MASK = $E0
DDSCAPS3_MULTISAMPLE_QUALITY_SHIFT = 5
DDSCAPS3_RESERVED1 = $100
DDSCAPS3_RESERVED2 = $200
DDSCAPS3_LIGHTWEIGHTMIPMAP = $400
DDSCAPS3_AUTOGENMIPMAP = $800
DDSCAPS3_DMAP = $1000
DDSCAPS3_CREATESHAREDRESOURCE = $2000
DDSCAPS3_READONLYRESOURCE = $4000
DDSCAPS3_OPENSHAREDRESOURCE = $8000

DDCAPS_3D = 1
DDCAPS_ALIGNBOUNDARYDEST = 2
DDCAPS_ALIGNSIZEDEST = 4
DDCAPS_ALIGNBOUNDARYSRC = 8
DDCAPS_ALIGNSIZESRC = $10
DDCAPS_ALIGNSTRIDE = $20
DDCAPS_BLT = $40
DDCAPS_BLTQUEUE = $80
DDCAPS_BLTFOURCC = $100
DDCAPS_BLTSTRETCH = $200
DDCAPS_GDI = $400
DDCAPS_OVERLAY = $800
DDCAPS_OVERLAYCANTCLIP = $1000
DDCAPS_OVERLAYFOURCC = $2000
DDCAPS_OVERLAYSTRETCH = $4000
DDCAPS_PALETTE = $8000
DDCAPS_PALETTEVSYNC = $10000
DDCAPS_READSCANLINE = $20000
DDCAPS_RESERVED1 = $40000
DDCAPS_VBI = $80000
DDCAPS_ZBLTS = $100000
DDCAPS_ZOVERLAYS = $200000
DDCAPS_COLORKEY = $400000
DDCAPS_ALPHA = $800000
DDCAPS_COLORKEYHWASSIST = $1000000
DDCAPS_NOHARDWARE = $2000000
DDCAPS_BLTCOLORFILL = $4000000
DDCAPS_BANKSWITCHED = $8000000
DDCAPS_BLTDEPTHFILL = $10000000
DDCAPS_CANCLIP = $20000000
DDCAPS_CANCLIPSTRETCHED = $40000000
DDCAPS_CANBLTSYSMEM = $80000000

DDCAPS2_CERTIFIED = 1
DDCAPS2_NO2DDURING3DSCENE = 2
DDCAPS2_VIDEOPORT = 4
DDCAPS2_AUTOFLIPOVERLAY = 8
DDCAPS2_CANBOBINTERLEAVED = $10
DDCAPS2_CANBOBNONINTERLEAVED = $20
DDCAPS2_COLORCONTROLOVERLAY = $40
DDCAPS2_COLORCONTROLPRIMARY = $80
DDCAPS2_CANDROPZ16BIT = $100
DDCAPS2_NONLOCALVIDMEM = $200
DDCAPS2_NONLOCALVIDMEMCAPS = $400
DDCAPS2_NOPAGELOCKREQUIRED = $800
DDCAPS2_WIDESURFACES = $1000
DDCAPS2_CANFLIPODDEVEN = $2000
DDCAPS2_CANBOBHARDWARE = $4000
DDCAPS2_COPYFOURCC = $8000
DDCAPS2_PRIMARYGAMMA = $20000
DDCAPS2_CANRENDERWINDOWED = $80000
DDCAPS2_CANCALIBRATEGAMMA = $100000
DDCAPS2_FLIPINTERVAL = $200000
DDCAPS2_FLIPNOVSYNC = $400000
DDCAPS2_CANMANAGETEXTURE = $800000
DDCAPS2_TEXMANINNONLOCALVIDMEM = $1000000
;Applications should use IDirectDraw7 (or higher?)
DDCAPS2_STEREO = $2000000
DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL = $4000000
DDCAPS2_RESERVED1 = $8000000
DDCAPS2_CANMANAGERESOURCE = $10000000
DDCAPS2_DYNAMICTEXTURES = $20000000
DDCAPS2_CANAUTOGENMIPMAP = $40000000
DDCAPS2_CANSHARERESOURCE = $80000000

DDFXALPHACAPS_BLTALPHAEDGEBLEND = 1
DDFXALPHACAPS_BLTALPHAPIXELS = 2
DDFXALPHACAPS_BLTALPHAPIXELSNEG = 4
DDFXALPHACAPS_BLTALPHASURFACES = 8
DDFXALPHACAPS_BLTALPHASURFACESNEG = $10
DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND = $20
DDFXALPHACAPS_OVERLAYALPHAPIXELS = $40
DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG = $80
DDFXALPHACAPS_OVERLAYALPHASURFACES = $100
DDFXALPHACAPS_OVERLAYALPHASURFACESNEG = $200

DDFXCAPS_BLTARITHSTRETCHY = $20
DDFXCAPS_BLTARITHSTRETCHYN = $10
DDFXCAPS_BLTMIRRORLEFTRIGHT = $40
DDFXCAPS_BLTMIRRORUPDOWN = $80
DDFXCAPS_BLTROTATION = $100
DDFXCAPS_BLTROTATION90 = $200
DDFXCAPS_BLTSHRINKX = $400
DDFXCAPS_BLTSHRINKXN = $800
DDFXCAPS_BLTSHRINKY = $1000
DDFXCAPS_BLTSHRINKYN = $2000
DDFXCAPS_BLTSTRETCHX = $4000
DDFXCAPS_BLTSTRETCHXN = $8000
DDFXCAPS_BLTSTRETCHY = $10000
DDFXCAPS_BLTSTRETCHYN = $20000
DDFXCAPS_OVERLAYARITHSTRETCHY = $40000
DDFXCAPS_OVERLAYARITHSTRETCHYN = $8
DDFXCAPS_OVERLAYSHRINKX = $80000
DDFXCAPS_OVERLAYSHRINKXN = $100000
DDFXCAPS_OVERLAYSHRINKY = $200000
DDFXCAPS_OVERLAYSHRINKYN = $400000
DDFXCAPS_OVERLAYSTRETCHX = $800000
DDFXCAPS_OVERLAYSTRETCHXN = $1000000
DDFXCAPS_OVERLAYSTRETCHY = $2000000
DDFXCAPS_OVERLAYSTRETCHYN = $4000000
DDFXCAPS_OVERLAYMIRRORLEFTRIGHT = $8000000
DDFXCAPS_OVERLAYMIRRORUPDOWN = $10000000
DDFXCAPS_OVERLAYDEINTERLACE = $20000000
DDFXCAPS_BLTALPHA = $00000001
DDFXCAPS_BLTFILTER = DDFXCAPS_BLTARITHSTRETCHY
DDFXCAPS_OVERLAYALPHA = $4
DDFXCAPS_OVERLAYFILTER = DDFXCAPS_OVERLAYARITHSTRETCHY

DDSVCAPS_RESERVED1 = 1
DDSVCAPS_RESERVED2 = 2
DDSVCAPS_RESERVED3 = 4
DDSVCAPS_RESERVED4 = 8
DDSVCAPS_STEREOSEQUENTIAL = $10

DDPCAPS_4BIT = 1
DDPCAPS_8BITENTRIES = 2
DDPCAPS_8BIT = 4
DDPCAPS_INITIALIZE = 0
DDPCAPS_PRIMARYSURFACE = $10
DDPCAPS_PRIMARYSURFACELEFT = $20
DDPCAPS_ALLOW256 = $40
DDPCAPS_VSYNC = $80
DDPCAPS_1BIT = $100
DDPCAPS_2BIT = $200
DDPCAPS_ALPHA = $400

DDSPD_IUNKNOWNPOINTER = 1
DDSPD_VOLATILE = 2

DDBD_1 = $4000
DDBD_2 = $2000
DDBD_4 = $1000
DDBD_8 = $800
DDBD_16 = $400
DDBD_24 = $200
DDBD_32 = $100

DDCKEY_COLORSPACE = 1
DDCKEY_DESTBLT = 2
DDCKEY_DESTOVERLAY = 4
DDCKEY_SRCBLT = 8
DDCKEY_SRCOVERLAY = $10

DDCKEYCAPS_DESTBLT = 1
DDCKEYCAPS_DESTBLTCLRSPACE = 2
DDCKEYCAPS_DESTBLTCLRSPACEYUV = 4
DDCKEYCAPS_DESTBLTYUV = 8
DDCKEYCAPS_DESTOVERLAY = $10
DDCKEYCAPS_DESTOVERLAYCLRSPACE = $20
DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV = $40
DDCKEYCAPS_DESTOVERLAYONEACTIVE = $80
DDCKEYCAPS_DESTOVERLAYYUV = $100
DDCKEYCAPS_SRCBLT = $200
DDCKEYCAPS_SRCBLTCLRSPACE = $400
DDCKEYCAPS_SRCBLTCLRSPACEYUV = $800
DDCKEYCAPS_SRCBLTYUV = $1000
DDCKEYCAPS_SRCOVERLAY = $2000
DDCKEYCAPS_SRCOVERLAYCLRSPACE = $4000
DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV = $8000
DDCKEYCAPS_SRCOVERLAYONEACTIVE = $10000
DDCKEYCAPS_SRCOVERLAYYUV = $20000
DDCKEYCAPS_NOCOSTOVERLAY = $40000

DDPF_ALPHAPIXELS = 1
DDPF_ALPHA = 2
DDPF_FOURCC = 4
DDPF_PALETTEINDEXED4 = 8
DDPF_PALETTEINDEXEDTO8 = $10
DDPF_PALETTEINDEXED8 = $20
DDPF_RGB = $40
DDPF_COMPRESSED = $80
DDPF_RGBTOYUV = $100
DDPF_YUV = $200
DDPF_ZBUFFER = $400
DDPF_PALETTEINDEXED1 = $800
DDPF_PALETTEINDEXED2 = $1000
DDPF_ZPIXELS = $2000
DDPF_STENCILBUFFER = $4000
DDPF_ALPHAPREMULT = $8000
DDPF_LUMINANCE = $20000
DDPF_BUMPLUMINANCE = $40000
DDPF_BUMPDUDV = $80000

DDENUMSURFACES_ALL = 1
DDENUMSURFACES_MATCH = 2
DDENUMSURFACES_NOMATCH = 4
DDENUMSURFACES_CANBECREATED = 8
DDENUMSURFACES_DOESEXIST = $10

DDSDM_STANDARDVGAMODE = 1
DDEDM_REFRESHRATES = 1
DDEDM_STANDARDVGAMODES = 2

DDSCL_FULLSCREEN = 1
DDSCL_ALLOWREBOOT = 2
DDSCL_NOWINDOWCHANGES = 4
DDSCL_NORMAL = 8
DDSCL_EXCLUSIVE = $10
DDSCL_ALLOWMODEX = $40
DDSCL_SETFOCUSWINDOW = $80
DDSCL_SETDEVICEWINDOW = $100
DDSCL_CREATEDEVICEWINDOW = $200
DDSCL_MULTITHREADED = $400
DDSCL_FPUSETUP = $800
DDSCL_FPUPRESERVE = $1000

DDBLT_ALPHADEST = 1
DDBLT_ALPHADESTCONSTOVERRIDE = 2
DDBLT_ALPHADESTNEG = 4
DDBLT_ALPHADESTSURFACEOVERRIDE = 8
DDBLT_ALPHAEDGEBLEND = $10
DDBLT_ALPHASRC = $20
DDBLT_ALPHASRCCONSTOVERRIDE = $40
DDBLT_ALPHASRCNEG = $80
DDBLT_ALPHASRCSURFACEOVERRIDE = $100
DDBLT_ASYNC = $200
DDBLT_COLORFILL = $400
DDBLT_DDFX = $800
DDBLT_DDROPS = $1000
DDBLT_KEYDEST = $2000
DDBLT_KEYDESTOVERRIDE = $4000
DDBLT_KEYSRC = $8000
DDBLT_KEYSRCOVERRIDE = $10000
DDBLT_ROP = $20000
DDBLT_ROTATIONANGLE = $40000
DDBLT_ZBUFFER = $80000
DDBLT_ZBUFFERDESTCONSTOVERRIDE = $100000
DDBLT_ZBUFFERDESTOVERRIDE = $200000
DDBLT_ZBUFFERSRCCONSTOVERRIDE = $400000
DDBLT_ZBUFFERSRCOVERRIDE = $800000
DDBLT_WAIT = $1000000
DDBLT_DEPTHFILL = $2000000
DDBLT_DONOTWAIT = $8000000
DDBLT_PRESENTATION = $10000000
DDBLT_LAST_PRESENTATION = $20000000

DDBLT_EXTENDED_FLAGS = $40000000
DDBLT_EXTENDED_LINEAR_CONTENT = 4

DDBLTFAST_NOCOLORKEY = 0
DDBLTFAST_SRCCOLORKEY = 1
DDBLTFAST_DESTCOLORKEY = 2
DDBLTFAST_WAIT = $10
DDBLTFAST_DONOTWAIT = $20

DDFLIP_WAIT = 1
DDFLIP_EVEN = 2
DDFLIP_ODD = 4
DDFLIP_NOVSYNC = 8
DDFLIP_INTERVAL2 = $2000000
DDFLIP_INTERVAL3 = $3000000
DDFLIP_INTERVAL4 = $4000000
DDFLIP_STEREO = 10
DDFLIP_DONOTWAIT = 20

DDOVER_ALPHADEST = 1
DDOVER_ALPHADESTCONSTOVERRIDE = 2
DDOVER_ALPHADESTNEG = 4
DDOVER_ALPHADESTSURFACEOVERRIDE = 8
DDOVER_ALPHAEDGEBLEND = $10
DDOVER_ALPHASRC = $20
DDOVER_ALPHASRCCONSTOVERRIDE = $40
DDOVER_ALPHASRCNEG = $80
DDOVER_ALPHASRCSURFACEOVERRIDE = $100
DDOVER_HIDE = $200
DDOVER_KEYDEST = $400
DDOVER_KEYDESTOVERRIDE = $800
DDOVER_KEYSRC = $1000
DDOVER_KEYSRCOVERRIDE = $2000
DDOVER_SHOW = $4000
DDOVER_ADDDIRTYRECT = $8000
DDOVER_REFRESHDIRTYRECTS = $10000
DDOVER_REFRESHALL = $20000
DDOVER_DDFX = $80000
DDOVER_AUTOFLIP = $100000
DDOVER_BOB = $200000
DDOVER_OVERRIDEBOBWEAVE = $400000
DDOVER_INTERLEAVED = $800000
DDOVER_BOBHARDWARE = $1000000
DDOVER_ARGBSCALEFACTORS = $2000000
DDOVER_DEGRADEARGBSCALING = $4000000

DDSETSURFACEDESC_RECREATEDC = 0
DDSETSURFACEDESC_PRESERVEDC = 1

DDLOCK_SURFACEMEMORYPTR = 0
DDLOCK_WAIT = 1
DDLOCK_EVENT = 2
DDLOCK_READONLY = $10
DDLOCK_WRITEONLY = $20
DDLOCK_NOSYSLOCK = $800
DDLOCK_NOOVERWRITE = $1000
DDLOCK_DISCARDCONTENTS = $2000
DDLOCK_OKTOSWAP = $2000
DDLOCK_DONOTWAIT = $4000
DDLOCK_HASVOLUMETEXTUREBOXRECT = $8000
DDLOCK_NODIRTYUPDATE = $10000

DDBLTFX_ARITHSTRETCHY = 1
DDBLTFX_MIRRORLEFTRIGHT = 2
DDBLTFX_MIRRORUPDOWN = 4
DDBLTFX_NOTEARING = 8
DDBLTFX_ROTATE180 = $10
DDBLTFX_ROTATE270 = $20
DDBLTFX_ROTATE90 = $40
DDBLTFX_ZBUFFERRANGE = $80
DDBLTFX_ZBUFFERBASEDEST = $100

DDOVERFX_ARITHSTRETCHY = 1
DDOVERFX_MIRRORLEFTRIGHT = 2
DDOVERFX_MIRRORUPDOWN = 4
DDOVERFX_DEINTERLACE = 8

DDWAITVB_BLOCKBEGIN = 1
DDWAITVB_BLOCKBEGINEVENT = 2
DDWAITVB_BLOCKEND = 4

DDGFS_CANFLIP = 1
DDGFS_ISFLIPDONE = 2

DDGBS_CANBLT = 1
DDGBS_ISBLTDONE = 2

DDENUMOVERLAYZ_BACKTOFRONT = 0
DDENUMOVERLAYZ_FRONTTOBACK = 1

DDOVERZ_SENDTOFRONT = 0
DDOVERZ_SENDTOBACK = 1
DDOVERZ_MOVEFORWARD = 2
DDOVERZ_MOVEBACKWARD = 3
DDOVERZ_INSERTINFRONTOF = 4
DDOVERZ_INSERTINBACKOF = 5

DDSGR_CALIBRATE = 1
DDSMT_ISTESTREQUIRED = 1

DDEM_MODEPASSED = 1
DDEM_MODEFAILED = 2

DD_OK = S_OK
DD_FALSE = S_FALSE

DDENUMRET_CANCEL = 0
DDENUMRET_OK = 1

DDERR_ALREADYINITIALIZED = $88760005
DDERR_CANNOTATTACHSURFACE = $8876000A
DDERR_CANNOTDETACHSURFACE = $88760014
DDERR_CURRENTLYNOTAVAIL = $88760028
DDERR_EXCEPTION = $88760037
DDERR_GENERIC = E_FAIL
DDERR_HEIGHTALIGN = $8876005A
DDERR_INCOMPATIBLEPRIMARY = $8876005F
DDERR_INVALIDCAPS = $88760064
DDERR_INVALIDCLIPLIST = $8876006E
DDERR_INVALIDMODE = $88760078
DDERR_INVALIDOBJECT = $88760082
DDERR_INVALIDPARAMS = E_INVALIDARG
DDERR_INVALIDPIXELFORMAT = $88760091
DDERR_INVALIDRECT = $88760096
DDERR_LOCKEDSURFACES = $887600A0
DDERR_NO3D = $887600AA
DDERR_NOALPHAHW = $887600B4
DDERR_NOSTEREOHARDWARE = $887600B5
DDERR_NOSURFACELEFT = $887600B6
DDERR_NOCLIPLIST = $887600CD
DDERR_NOCOLORCONVHW = $887600D2
DDERR_NOCOOPERATIVELEVELSET = $887600D4
DDERR_NOCOLORKEY = $887600D7
DDERR_NOCOLORKEYHW = $887600DC
DDERR_NODIRECTDRAWSUPPORT = $887600DE
DDERR_NOEXCLUSIVEMODE = $887600E1
DDERR_NOFLIPHW = $887600E6
DDERR_NOGDI = $887600F0
DDERR_NOMIRRORHW = $887600FA
DDERR_NOTFOUND = $887600FF
DDERR_NOOVERLAYHW = $88760104
DDERR_OVERLAPPINGRECTS = $8876010E
DDERR_NORASTEROPHW = $88760118
DDERR_NOROTATIONHW = $88760122
DDERR_NOSTRETCHHW = $88760136
DDERR_NOT4BITCOLOR = $8876013C
DDERR_NOT4BITCOLORINDEX = $8876013D
DDERR_NOT8BITCOLOR = $88760140
DDERR_NOTEXTUREHW = $8876014A
DDERR_NOVSYNCHW = $8876014F
DDERR_NOZBUFFERHW = $88760154
DDERR_NOZOVERLAYHW = $8876015E
DDERR_OUTOFCAPS = $88760168
DDERR_OUTOFMEMORY = E_OUTOFMEMORY
DDERR_OUTOFVIDEOMEMORY = $8876017C
DDERR_OVERLAYCANTCLIP = $8876017E
DDERR_OVERLAYCOLORKEYONLYONEACTIVE = $88760180
DDERR_PALETTEBUSY = $88760183
DDERR_COLORKEYNOTSET = $88760190
DDERR_SURFACEALREADYATTACHED = $8876019A
DDERR_SURFACEALREADYDEPENDENT = $887601A4
DDERR_SURFACEBUSY = $887601AE
DDERR_CANTLOCKSURFACE = $887601B3
DDERR_SURFACEISOBSCURED = $887601B8
DDERR_SURFACELOST = $887601C2
DDERR_SURFACENOTATTACHED = $887601CC
DDERR_TOOBIGHEIGHT = $887601D6
DDERR_TOOBIGSIZE = $887601E0
DDERR_TOOBIGWIDTH = $887601EA
DDERR_UNSUPPORTED = E_NOTIMPL
DDERR_UNSUPPORTEDFORMAT = $887601FE
DDERR_UNSUPPORTEDMASK = $88760208
DDERR_INVALIDSTREAM = $88760209
DDERR_VERTICALBLANKINPROGRESS = $88760219
DDERR_WASSTILLDRAWING = $8876021C
DDERR_DDSCAPSCOMPLEXREQUIRED = $8876021E
DDERR_XALIGN = $88760230
DDERR_INVALIDDIRECTDRAWGUID = $88760231
DDERR_DIRECTDRAWALREADYCREATED = $88760232
DDERR_NODIRECTDRAWHW = $88760233
DDERR_PRIMARYSURFACEALREADYEXISTS = $88760234
DDERR_NOEMULATION = $88760235
DDERR_REGIONTOOSMALL = $88760236
DDERR_CLIPPERISUSINGHWND = $88760237
DDERR_NOCLIPPERATTACHED = $88760238
DDERR_NOHWND = $88760239
DDERR_HWNDSUBCLASSED = $8876023A
DDERR_HWNDALREADYSET = $8876023B
DDERR_NOPALETTEATTACHED = $8876023C
DDERR_NOPALETTEHW = $8876023D
DDERR_BLTFASTCANTCLIP = $8876023E
DDERR_NOBLTHW = $8876023F
DDERR_NODDROPSHW = $88760240
DDERR_OVERLAYNOTVISIBLE = $88760241
DDERR_NOOVERLAYDEST = $88760242
DDERR_INVALIDPOSITION = $88760243
DDERR_NOTAOVERLAYSURFACE = $88760244
DDERR_EXCLUSIVEMODEALREADYSET = $88760245
DDERR_NOTFLIPPABLE = $88760246
DDERR_CANTDUPLICATE = $88760247
DDERR_NOTLOCKED = $88760248
DDERR_CANTCREATEDC = $88760249
DDERR_NODC = $8876024A
DDERR_WRONGMODE = $8876024B
DDERR_IMPLICITLYCREATED = $8876024C
DDERR_NOTPALETTIZED = $8876024D
DDERR_UNSUPPORTEDMODE = $8876024E
DDERR_NOMIPMAPHW = $8876024F
DDERR_INVALIDSURFACETYPE = $88760250
DDERR_NOOPTIMIZEHW = $88760258
DDERR_NOTLOADED = $88760259
DDERR_NOFOCUSWINDOW = $8876025A
DDERR_NOTONMIPMAPSUBLEVEL = $8876025B
DDERR_DCALREADYCREATED = $8876026C
DDERR_NONONLOCALVIDMEM = $88760276
DDERR_CANTPAGELOCK = $88760280
DDERR_CANTPAGEUNLOCK = $88760294
DDERR_NOTPAGELOCKED = $887602A8
DDERR_MOREDATA = $887602B2
DDERR_EXPIRED = $887602B3
DDERR_TESTFINISHED = $887602B4
DDERR_NEWMODE = $887602B5
DDERR_D3DNOTINITIALIZED = $887602B6
DDERR_VIDEONOTACTIVE = $887602B7
DDERR_NOMONITORINFORMATION = $887602B8
DDERR_NODRIVERSUPPORT = $887602B9
DDERR_DEVICEDOESNTOWNSURFACE = $887602BB
DDERR_NOTINITIALIZED = CO_E_NOTINITIALIZED
